<?php

namespace App\Observers;

use App\Person;
use Illuminate\Support\Facades\Log;

class PersonObserver
{
    /**
     * Handle the user "created" event.
     *
     * @param  \App\Person  $person
     * @return void
     */
    public function created(Person $person)
    {
        Log::info('即将 created 用户到数据库[' . $person->id . ']' . $person->name);
    }

    /**
     * Handle the user "updated" event.
     *
     * @param  \App\Person  $person
     * @return void
     */
    public function updated(Person $person)
    {
        Log::info('即将 update 用户到数据库[' . $person->id . ']' . $person->name);
    }

    /**
     * Handle the user "deleted" event.
     *
     * @param  \App\Person  $person
     * @return void
     */
    public function deleted(Person $person)
    {
        Log::info('即将 delete 用户到数据库[' . $person->id . ']' . $person->name);
    }

    /**
     * Handle the user "restored" event.
     *
     * @param  \App\Person  $person
     * @return void
     */
    public function restored(Person $person)
    {
        Log::info('即将 restored 用户到数据库[' . $person->id . ']' . $person->name);
    }

    /**
     * Handle the user "force deleted" event.
     *
     * @param  \App\Person  $person
     * @return void
     */
    public function forceDeleted(Person $person)
    {
        Log::info('即将force delete 用户到数据库[' . $person->id . ']' . $person->name);
    }
    
    /**
     * @param Person $person
     */
    public function retrieved(Person $person)
    {
        Log::info('即将 retrieve 用户到数据库[' . $person->id . ']' . $person->name);
    }
}
